-- =============================================
CREATE PROCEDURE [dbo].[SELMetricasDeUnPerfil]
	-- Add the parameters for the stored procedure here
	@IdPerfil int = 0
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	
	
	SELECT 
		M.idMetrica, M.NombreMetrica, M.Descripcion
	FROM 
		Tibet.dbo.Perfil_Metrica P, 
		Tibet.dbo.Metrica M, 
		Tibet.dbo.Perfil_Metrica_Metrica P_M
	WHERE 
		P.idPerfilMetrica=@IdPerfil AND 
		P.idPerfilMetrica = P_M.Fk_Perfil_Metrica_idPerfil_Metrica AND 
		P_M.Fk_Metrica_idMetrica = M.idMetrica;
	
	
END

